package com.sk.seckilldemo.enums;

import lombok.Getter;

/**
 * 秒杀系统状态码枚举
 */
@Getter
public enum ResultCodeEnum {
    SUCCESS(200, "操作成功"),
    SYSTEM_ERROR(500, "系统繁忙"),
    STOCK_NOT_ENOUGH(4001, "库存不足"),
    DUPLICATE_ORDER(4002, "重复下单"),
    ACTIVITY_NOT_START(4003, "活动未开始"),
    ORDER_ERROR_NONE(4004, "订单不存在或状态已变更"),
    //文件上传相关
    UPLOAD_SUCCESS(200,"上传成功"),
    UPLOAD_ERROR(4005,"上传失败"),
    //商品分类相关
    ADD_CLASSES_SUCCESS(200,"商品分类添加成功"),
    ADD_CLASSES_ERROR(4006,"商品分类添加失败"),
    UPDATE_CLASSES_SUCCESS(200,"商品分类更新成功"),
    UPDATE_CLASSES_ERROR(4007,"商品分类更新失败"),
    DELETE_CLASSES_SUCCESS(200,"商品分类删除成功"),
    DELETE_CLASSES_ERROR(4009,"商品分类删除失败"),
    QUERY_CLASSES_SUCCESS(200,"商品分类查询成功"),
    QUERY_CLASSES_ERROR(200,"商品分类查询失败"),

    // 用户相关错误信息
    LOGIN_SUCCESS(200,"登录成功"),
    LOGIN_ERROR(401,"登录失败");

    private final Integer code;
    private final String msg;

    ResultCodeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
